import { dialog } from '@gis/lib/components/antd-dialog';

export function openEquipmentAlarmListDialog() {
  dialog({
    content: () => import('./equipment-alarm-list.vue'),
    contentProps: {},
    dialogProps: {
      title: '设备告警列表',
      width: 'large',
      footer: null,
      height: 'fixed',
      bodyStyle: { padding: 0 },
    },
  });
}

// 物联设备 - 门禁列表
export function openEquipmentRlmjDialog(data = { name: '', area_code: '' }) {
  dialog({
    content: () => import('./equipment-rlmj-list.vue'),
    contentProps: {
      ...data,
    },
    dialogProps: {
      title: (data.name || '') + '设备列表',
      width: 'large',
      height: 'fixed',
      footer: null,
    },
  });
}
export function openEquipmentRlmjDetailsDialog(data) {
  dialog({
    content: () => import('./face-entrance-detail.vue'),
    contentProps: { detail: data },
    dialogProps: {
      title: '详情',
      footer: null,
    },
  });
}
export function openEquipmentCldzDetailsDialog(data) {
  dialog({
    content: () => import('./equipment-cldz-detail.vue'),
    contentProps: { detail: data },
    dialogProps: {
      title: '详情',
      footer: null,
    },
  });
}
export function openEquipmentDjzdDetailsDialog(data) {
  dialog({
    content: () => import('./equipment-djzd-detail.vue'),
    contentProps: { detail: data },
    dialogProps: {
      title: '详情',
      footer: null,
    },
  });
}
// 物联设备 - 列表
export function openEquipmentDialog({ type, name, area_code }) {
  dialog({
    content: () => import('./iot-list.vue'),
    contentProps: { type, area_code },
    dialogProps: {
      title: (name || '') + '设备列表',
      width: 'large',
      height: 'fixed',
      footer: null,
    },
  });
}
export function openGoodsDeviceDialog(data) {
  dialog({
    content: () => import('./iot-details.vue'),
    contentProps: { id: data.id },
    dialogProps: { title: `『${data.name}』详情`, footer: null, width: 'medium' },
  });
}
